home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / gfx / show / Bview_102.lha / Bview102 / PicSrc / picture.c < prev    next >
C/C++ Source or Header  |  1993-12-03  |  2KB  |  87 lines

  1. // Changed by Joeri Alberty to work with bview 0.99 and higher as example 
  2. // 03/09/93                                                               
  3.  
  4. // Shows you how to include C Source from IFF Picture in your own Source. 
  5.  
  6. // The color table used in BASF.h is 4 bits/gun. These are TRIPLETS.       
  7. // You use here the function LoadRGB4().
  8. // Set in Bview 'Save picture' 'Colors' on '4 bits per gun (CYCLE gadget).
  9.  
  10. // For AGA 32 bits/gun use LoadRGB32() (ULONG). 
  11. // Set in Bview 'Save picture' 'Colors' on '32 bits per gun (CYCLE gadget).
  12. // Bview will make than a table for this function.
  13.  
  14. /*
  15. This example is provided in electronic form by Commodore-Amiga, Inc. for
  16. use with the "Amiga ROM Kernel Reference Manual: Libraries", 3rd Edition,
  17. published by Addison-Wesley (ISBN 0-201-56774-1).
  18. */
  19.  
  20. #define INTUI_V36_NAMES_ONLY
  21.  
  22. #include <exec/types.h>
  23. #include <intuition/intuition.h>
  24. //#include <intuition/intuitionbase.h>
  25. #include <graphics/displayinfo.h>
  26. #include <graphics/gfxbase.h>
  27. #include <stdio.h>
  28.  
  29. #include <clib/exec_protos.h>
  30. #include <clib/alib_protos.h>
  31. #include <clib/dos_protos.h>
  32. #include <clib/intuition_protos.h>
  33. #include <clib/graphics_protos.h>
  34.  
  35. #include <pragmas/graphics_pragmas.h>
  36. #include <pragmas/intuition_pragmas.h>
  37.  
  38. /* My .h file made by Bview */
  39.  
  40. #include "BASF.h"
  41.  
  42. #ifdef LATTICE
  43. int CXBRK(void)    { return(0); }  /* Disable Lattice CTRL/C handling */
  44. int chkabort(void) { return(0); }  /* really */
  45. #endif
  46.  
  47. struct IntuitionBase *IntuitionBase = NULL;
  48. struct GfxBase       *GfxBase = NULL;
  49. //UWORD pens[] = { ~0 };
  50.  
  51. VOID main(int argc, char *argv[])
  52. {
  53. struct Screen *scr;
  54. struct Window *win;
  55.  
  56. if(IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",37))
  57.   {  
  58.   if(GfxBase = (struct GfxBase *)OpenLibrary("graphics.library",37))
  59.     {
  60.     if (NULL != (scr = OpenScreenTags(NULL,
  61.                         SA_DisplayID,   ModeID,
  62.                         SA_Depth,       4,
  63.                         TAG_END)))
  64.         {
  65.         LoadRGB4(&scr->ViewPort,colortable,16);
  66.  
  67.  
  68.         if (NULL != (win = OpenWindowTags(NULL,
  69.                             WA_RMBTrap,      TRUE,
  70.                             WA_CustomScreen, scr,
  71.                             TAG_END)))
  72.             {
  73.  
  74.             DrawImage(win->RPort,&Im_Pic,10,10);
  75.  
  76.             Delay(500);
  77.  
  78.             CloseWindow(win);
  79.             }
  80.         CloseScreen(scr);
  81.         }
  82.     CloseLibrary((struct Library *)GfxBase);
  83.     }
  84.   CloseLibrary((struct Library *)IntuitionBase);
  85.   }
  86. }
  87.